from app import create_app, db
from app.models import User
import uuid

app = create_app()
with app.app_context():
    user = User.query.get(1)
    if not user:
        print("id=1 的用户不存在")
    else:
        for i in range(102):
            new_user = User(
                ip=user.ip,
                device_uuid=str(uuid.uuid4()),  # 保证唯一
                device_fingerprint=f"{user.device_fingerprint}_{i}",
                signature=user.signature,
                signature_image=user.signature_image,
                room_number=user.room_number,
            )
            db.session.add(new_user)
        db.session.commit()
        print("已复制102条测试数据")